<template>
  <view class="ssguiz-container">
    <!-- <rich-text :nodes="richTextContent" class="rich-text-content" /> -->
     <image class="ssguiz-img" :src="thumb" mode="widthFix" />

  </view>
</template>

<script>
export default {
  data() {
    return {
      richTextContent: "",
	  thumb:''
    }
  },
  onLoad() {
    this.fetchNews();
  },
  methods: {
    async fetchNews() {
      try {
        const res = await uni.request({
          url: 'http://chaoxiang.scoringchina.com/index/api/guizhang',
          method: 'GET'
        });
        if(res && res.data && res.data.code === 1) {
          this.richTextContent = res.data.data.content || "";
		  this.thumb = res.data.data.thumb || ''
        } else {
          console.error('获取数据失败', res[1]);
        }
      } catch (error) {
        console.error('请求异常', error);
      }
    },
  
  }
}
</script>

<style scoped>
.ssguiz-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 0;
}
.ssguiz-img {
  width: 100vw;
  display: block;
  margin: 0 auto;
}
.rich-text-content {
  width: 94vw;
  margin: 20rpx auto;
  font-size: 28rpx;
  color: #333;
  line-height: 1.6;
}
/* 富文本容器 */
.ssguiz-container ::v-deep p {
  text-align: center; /* 居中 */
  margin: 0;
  padding: 0;
}

.ssguiz-container ::v-deep img {
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}
</style>